home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group97a.txt / 000130_icon-group-sender _Tue Jun 10 14:00:39 1997.msg < prev    next >
Internet Message Format  |  2000-09-20  |  2KB

  1. Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Tue, 10 Jun 1997 12:28:00 MST
  2. Received: by kingfisher.CS.Arizona.EDU; (5.65v3.2/1.1.8.2/08Nov94-0446PM)
  3.     id AA08374; Tue, 10 Jun 1997 12:28:00 -0700
  4. Sender: rpereda@micro.ti.com
  5. Message-Id: <339DA457.592990BB@micro.ti.com>
  6. Date: Tue, 10 Jun 1997 14:00:39 -0500
  7. From: Ray Pereda <rpereda@micro.ti.com>
  8. Organization: Texas Instruments
  9. X-Mailer: Mozilla 3.0Gold (X11; I; SunOS 4.1.4 sun4m)
  10. Mime-Version: 1.0
  11. To: Stuart Robinson <Stuart.Robinson@anu.edu.au>
  12. Cc: icon-group@cs.arizona.edu
  13. Subject: Re: searching with variables
  14. References: <Stuart.Robinson-1006972230400001@asianstmg-221.anu.edu.au>
  15. Content-Type: text/plain; charset=us-ascii
  16. Content-Transfer-Encoding: 7bit
  17. Errors-To: icon-group-errors@cs.arizona.edu
  18. Status: RO
  19. Content-Length: 1206
  20.  
  21. Stuart Robinson wrote:
  22.  
  23. Consider something like this:
  24.  
  25. sparrow:[icon] ==> more vl.icn
  26. procedure main()
  27.   line := "abc al el abc il ol abc ul"
  28.   V    := 'aeiou'
  29.   line ? {
  30.     while (tab(upto(V)) & a := move(1) & b := ="l" ) do {
  31.       write("matched = ", a, b)
  32.     }
  33.   }
  34. end
  35.  
  36. sparrow:[icon] ==> vl
  37. matched = al
  38. matched = el
  39. matched = il
  40. matched = ol
  41. matched = ul
  42.  
  43. -ray
  44.  
  45. > A quick question.  If you wanted to use the function find() to search for
  46. > a particular strings of characters, how would it be possible to define
  47. > character variables?  For example, suppose you want to search for the
  48. > following sequences
  49. > al
  50. > el
  51. > il
  52. > ol
  53. > ul
  54. > which are really just Vl (where V stands for a vowel).  Could you simply
  55. > define a character set for vowels (V := 'aeiou') and then refer to that
  56. > character set in the find() function?  If so, what would it look like?  I
  57. > tried something like the following and it didn't work.
  58. > find( V || "l")
  59. > I realise it's a pretty trivial task but I don't have the manual at the
  60. > moment and I'd like an answer within the next couple of days.  Thanks in
  61. > advance.
  62. > --
  63. > Stuart Robinson <Stuart.Robinson@anu.edu.au>
  64. > The Australian National University
  65.